package com.chenxin.wms.controller;

import com.chenxin.common.core.controller.BaseController;
import com.chenxin.common.core.domain.AjaxResult;
import com.chenxin.common.core.page.TableDataInfo;
import com.chenxin.wms.domain.vo.DeliverDetailVO;
import com.chenxin.wms.service.IDeliverDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/wms/deliverDetails")
public class DeliverDetailController extends BaseController {
    @Autowired
    private IDeliverDetailService deliverDetailService;

    @PreAuthorize("@ss.hasPermi('wms:deliverDetails:list')")
    @GetMapping("/list")
    public TableDataInfo list(DeliverDetailVO deliverDetailVO) {
        startPage();
        List<DeliverDetailVO> list = deliverDetailService.selectDeliverDetailList(deliverDetailVO);
        return getDataTable(list);
    }

    @PreAuthorize("@ss.hasPermi('wms:deliverDetails:query')")
    @GetMapping(value = {"/", "/{deliverDetailId}"})
    public AjaxResult getInfo(@PathVariable(value = "deliverDetailId") Long deliverDetailId) {
        return success(deliverDetailService.selectDeliverDetailById(deliverDetailId));
    }
}
